<%@page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>创业武汉合伙人</title>
    <%@include file="common/header.jsp"%>
    </head>
<body>

<!-- 

  
                
    <div class="list-block media-list">
      <ul>
        <li>
          <label class="label-checkbox item-content">
            <input name="id" type="checkbox">
            <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
            
                    <a href="<%--readMessage/${news.id}.do--%>"  class="readMessage">
            <div class="item-inner">
              <div class="item-title-row">
                <div class="item-title typeDesc">${typeDesc}</div>
                <div class="item-after time"></div>
              </div>
              <div class="item-subtitle noticeDesc"></div>
              <div class="item-text"></div>
            </div>
            </a>
          </label>
        </li>
      </ul>
    </div>


 -->

<!-- page 容器 -->
<div class="page" data-router="true">
    <!-- 标题栏 -->
    <header class="bar bar-nav bgcolor nobottom">
        <a class="button button-link button-nav whitecolor pull-left back  no-transition external" href="${ctx}/m/news.do">
            <span class="icon icon-left"></span>
        </a><!-- 
    	<a href="#" class="icon whitecolor pull-right create-actions">操作</a> -->
        <h1 class="title whitecolor">消息</h1>
    </header>
    
    <!-- 这里是页面内容区 -->
    <div class="content infinite-scroll" data-distance="100">
        <div class="contentList" data-totalPage="${pager.totalPage}" data-pageNum="1">
            <%--<c:forEach items="${pager.resultList}" var="news">--%>
                <div class="news">
                    <a href="<%--readMessage/${news.id}.do--%>"  class="readMessage">
                        <div class="time"><%--${news.createDate}--%></div>
                        <div class="news_content">
                            <span class="little_size">
                                <strong class="typeDesc">${typeDesc}</strong>
                            </span><br/>
                            <span class="little_size noticeDesc"><%--${news.noticeDesc}--%></span>
                        </div>
                    </a>
                </div>
                
              
            <%--</c:forEach>--%>
        </div>
        <!-- preloader -->
        <%--<c:if test="${pager.totalPage>=2}">--%>
            <div class="infinite-scroll-preloader">
                <div class="preloader"></div>
            </div>
        <%--</c:if>--%>
    </div>

</div>

<%@include file="common/panel.jsp"%>
</body>
</html>

<%@include file="common/footer.jsp"%>
<%@include file="common/nav_header_new.jsp" %>
<script>
    $.init();

    $(document).on('click','.create-actions', function () {
        var buttons1 = [
          {
            text: '请选择',
            label: true
          },
          {
            text: '全部设为已经读',
            bold: true,
            color: 'danger',
            onClick: function() {
              $.alert("你选择了“全部设为已经读“");
            }
          },
          {
            text: '全部删除',
            bold: true,
            color: 'danger',
            onClick: function() {
              $.alert("你选择了“全部设为已经读“");
            }
          },
          {
            text: '已选中的设为已经读',
            onClick: function() {
              $.alert("你选择了“买入“");
            }
          },
          {
              text: '已选中的删除',
              onClick: function() {
                $.alert("你选择了“买入“");
              }
            }
        ];
        var buttons2 = [
          {
            text: '取消',
            bg: 'danger'
          }
        ];
        var groups = [buttons1, buttons2];
        $.actions(groups);
    }); 
    
    
    var objBase = $(".contentList > .news").eq(0).clone();
    var contentList = $(".contentList");
    contentList.empty();

    var loading = false;
    var url = "${ctx}/m/newsPager.do?noticeType=${noticeType}";
    function addItems(data,content) {
        $.each(data.resultList,function(){
            var obj = objBase.clone();
            var read = "";
            if(this.readStatus=='read'){
                read = read + '【已读】';
            }else{
            	read = read + '【未读】';
            }
            obj.find(".typeDesc").append(read);
            obj.find(".time").text((new Date(this.createDate)).Format("yyyy-MM-dd hh:mm"));
            obj.find(".noticeDesc").text(this.noticeDesc);
            obj.find(".readMessage").attr("href","readMessage/"+this.id+".do");
            content.append(obj);
        });
        var pageNum = parseInt(content.attr("data-pageNum"))+1;
        content.attr("data-pageNum",pageNum);
    }

    function queryUrl() {
        return "${ctx}/m/newsPager.do?noticeType=${noticeType}";
    }

    ajaxTODO(null, contentList, true);


    $(document).on('click',$(".readMessage"),(function(){
        //$(this).find(".typeDesc").text("${typeDesc}【已读】");
    }));
</script>
